<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class Order extends Model
{

    use SoftDeletes;
    public function products(){
        return $this->belongsToMany('App\Models\Product','order_products','order_id','product_id')
            ->withPivot('product_name','image_id','current_price','activity_type','activity_id','quantity','total_price')
            ->withTimestamps();
    }

    public function address(){
        return $this->hasOne('App\Models\OrderAddress','order_id','id');
    }





}
